package cate.game.train.hero.msg;

import cate.game.GameBody;
import cate.game.client.ClientContext;
import cate.game.client.msg.ClientMsg;
import cate.game.client.msg.MsgConfig;
import cate.game.client.msg.MsgInput;
import cate.game.client.msg.id.MsgIdBTrain;
import easy.java.dev.note.NoteField;
import easy.java.practice.errorcode.EcResult;

@ClientMsg(title = "英雄锁定 的 请求")
public class HeroLockReq implements MsgInput {
    @NoteField(value = "英雄uid")
    public String uid;

    @Override
    public void execute(GameBody game, ClientContext cc) {
        EcResult<Void> r = game.train.hero.lockHero(cc.getRole(), uid);
        if(!r.ok()){
            game.notice.message(cc.getRole(), r.message);
        }
    }

    @Override
    public MsgConfig conf() {
        return MsgIdBTrain.HERO_LOCK_REQ;
    }
}
